home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / traverse < prev    next >
Internet Message Format  |  1995-03-31  |  3KB

  1. From helens!shelby!rutgers!usc!hacgate!tcville.HAC.COM!ferris Mon Jun 18 11:37:05 PDT 1990
  2. Status: RO
  3.  
  4. Article 1935 of comp.sys.handhelds:
  5. Path: helens!shelby!rutgers!usc!hacgate!tcville.HAC.COM!ferris
  6. >From: ferris@tcville.HAC.COM
  7. Newsgroups: comp.sys.handhelds
  8. Subject: HP48 Directory Traversal
  9. Message-ID: <8949@hacgate.UUCP>
  10. Date: 18 Jun 90 05:46:38 GMT
  11. Sender: news@hacgate.UUCP
  12. Reply-To: ferris@tcville.HAC.COM ()
  13. Organization: Hughes Aircraft Co., El Segundo, CA
  14. Lines: 58
  15.  
  16.  
  17. I have vastly enjoyed programming with my HP48, and have been
  18. aided immensely by the posts from this newsgroup. To start
  19. what I hope will be the first of many contributing posts I
  20. hope to make, here is a brief program to traverse the directories
  21. in your HP48.
  22.  
  23. As written, it does nothing. However, I have indicated that point
  24. to modify to slip in the action you wish to occur at each 
  25. directory (such as purge all system created variables, add variables
  26. you want in each directory, accumulate a system wide listing, etc).
  27.  
  28. Also, as written, it scans all directories from the current one on
  29. down. Comments point out where to add a HOME command to make the
  30. program always start at the HOME directory and scan down from there.
  31.  
  32. This program calls itself recursively, so must reside in the HOME
  33. directory, with the same that it calls itself in the code, which
  34. is TRAVERSE. If you change the name, also change the name in the
  35. code.
  36.  
  37. %%HP: T(3)A(D)F(.);
  38. @ Store as 'TRAVERSE' in the HOME directory
  39. @ BYTES returns 1: 6E96h  2: 157.5
  40. @
  41. @ TRAVERSE is a directory traversal program
  42. @ It must be stored in the HOME directory as it calls itself
  43. @ recursively while visiting all RAM directories.
  44. @
  45. @ Mark Ferris        ferris@tcville.HAC.COM
  46. @ version 1.0    6/14/90
  47. \<<
  48.  DEPTH
  49.   IF 0 \=/            @ if stack is not empty, assume the current
  50.   THEN DUP RCL TYPE        @ directory list is on the stack
  51.     IF 15 ==
  52. @ at this point, have located a directory. It's name
  53. @ is on level 1 of the stack.
  54. @ Replace the HALT instruction with whatever you want to do
  55. @ in the directory
  56.     THEN HALT EVAL VARS OBJ\-> 1 SWAP
  57.       FOR x TRAVERSE
  58.       NEXT
  59.     ELSE DROP
  60.     END
  61. @ Add the command HOME prior to VARS if
  62. @ you want TRAVERSE to always traverse your entire
  63. @ directory, otherwise it will start at the
  64. @ current directory
  65.   ELSE VARS OBJ\-> 1 SWAP    @ else (if stack is empty)
  66.     FOR x TRAVERSE        @ program just started execution
  67.     NEXT HOME            @ begin traversal at the current
  68.   END                @ directory
  69. \>>
  70.  
  71. Mark Ferris                         smart:    ferris@tcville.edsg.hac.com
  72. Image and Signal Processing Lab     dumb:     ferris%tcville@hac2arpa.hac.com
  73. Hughes Aircraft Co., EDSG           uucp:     hacgate!tcville!ferris
  74.  
  75.  
  76.